<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<include file="Public:base" />
<script type="text/javascript">
$(document).ready(function() {

	
	$("#cateform").validate({
		
		errorPlacement: function (error, element) {
            error.appendTo(element.parent().find('label'));
            element.parent().addClass("has-error");
        },
        //获取焦点时不验证 
        focusInvalid: false,   
        onkeyup: false ,
        rules: {
	        'name': {
	            required: true
	           
	        },
	        'orderby': {
	            required: true,
	            range:[1,99]
	        }
	    },
	    messages: {
	        'name': {
	            required: "请输入分类名称 "
	        },
	        'orderby': {
	            required: "请输入排序值",
	            range:"请输入1~99的整数"
	        }
	    }
	});
	
	
});

</script>
</head>
<body>
<include file="Public:header" />

<div class="home-index">
	<div class="container">
	    <div class="row">
	      <ol class="breadcrumb">
	        <li>首页</li>
	        <li><a class='' href="__URL__/index">分类管理</a></li>
	        <li class="active">添加分类</li>
	      </ol>

		<div class="comm-box">

			<!-- Tab panes -->
			<div class="tab-content">
				<div class="tab-pane active" id="info">
					<form id="cateform" role="form" method="post" action="__URL__/update">
						<div class="form-group">
							<label >名称</label>
							<input type="text" name="name" placeholder="请输入分类名称" class="form-control" value='{$data.name}'></div>
						
						<!-- 
						<div class="form-group">
							<label >排序值(默认：99,值越小 越靠前)</label>
							<input type="text" name="orderby" class="form-control" value='{$data.orderby}' placeholder="请输入1~99的数字">
						</div>
						 -->
						
						<input type="hidden" name="id"  value='{$data.id}' >
						<button type="submit" class="btn btn-primary">提交</button>
					</form>

				</div>
			</div>
</div>
		</div>
	</div>
</div>

</body>
</html>